<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <component-a></component-a>
        <component-a></component-a>
    </div>
</body>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    Vue.component('component-a', {
        template: '<div><h1>头部组件--{{name}}</h1></div>',
        data: function () {
            return {
                name: '全局组件'
            }
        }
    })
    var vm = new Vue({
        el: '#app'
    })
</script>

</html>